export default [{
  name: 'APP_LOGIN_SUCCESS',
  callback: function (e) {
    this.$router.push({
      name: 'admin'
    })
  }
},
{
  name: 'APP_LOGOUT_SUCCESS',
  callback: function (e) {
    this.$store.commit('clearAll')
    this.$router.replace({
      name: 'login'
    })
  }
},
{
  name: 'APP_PAGE_LOADED',
  callback: function (e) {}
},
{
  name: 'APP_AUTH_FAILED',
  callback: function (e) {
    this.$router.push('/login')
    this.$message.error('Token has expired')
  }
},
{
  name: 'APP_BAD_REQUEST',
  // @error api response data
  callback: function (msg) {
    this.$message.error(msg)
  }
},
{
  name: 'APP_ACCESS_DENIED',
  // @error api response data
  callback: function (msg) {
    this.$message.error(msg)
    this.$router.push('/401')
  }
},
{
  name: 'APP_RESOURCE_DELETED',
  // @error api response data
  callback: function (msg) {
    this.$message.success(msg)
  }
},
{
  name: 'APP_RESOURCE_UPDATED',
  // @error api response data
  callback: function (msg) {
    this.$message.success(msg)
  }
}, {
  name: 'APP_ROUTE_TO',
  // @error api response data
  callback: function (params) {
    this.$router.push(params)
  }
}

]
